package com.nervenets.shopping.controller.common.params;

import com.nervenets.general.adapter.jsonType.StringArrayJson;
import com.nervenets.general.web.params.FormParams;
import com.nervenets.shopping.enumeration.UnionType;
import com.nervenets.shopping.hibernate.domain.common.Feedback;
import com.nervenets.shopping.service.FeedbackService;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Type;

import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class FeedbackFormParams extends FormParams<Feedback, FeedbackService> {
    @ApiModelProperty(value = "关联类型", required = true)
    @NotNull
    private UnionType unionType;
    @ApiModelProperty(value = "关联ID,App投诉定为6666", required = true)
    @Positive
    private long unionId;
    @ApiModelProperty(value = "内容", required = true)
    @NotBlank
    @Size(min = 20)
    private String content;
    @ApiModelProperty(value = "图片")
    @Type(type = StringArrayJson.NAME)
    @Column(columnDefinition = "json")
    private List<String> images;
}
